<template>
   <div class="mui-numbox" data-numbox-min='1'>
					<button class="mui-btn mui-btn-numbox-minus" @click="bbbb" type="button">-</button>
					<input id="test" class="mui-input-numbox" type="number" ref="numbox" readonly v-model="initcount" />
					<button class="mui-btn mui-btn-numbox-plus" @click="aaaa" type="button">+</button>
	</div>  
</template>
<script>
import mui from "../../lib/mui/mui-master/dist/js/mui.min.js";
export default {
props: ["initCount","goodsId"],
  data(){
      return{
        initcount:this.initCount
      }
  },
  mounted(){
    mui(".mui-box").numbox();
  },
  watch:{
    initcount:function(newVal){
        this.$store.commit("updateGoodsInfo",{id:this.goodsId,sellCount:newVal})
    }
  },
  methods: {
    aaaa(){
       this.initcount++;
    },
    bbbb(){
        this.initcount--;
        if(this.initcount<=1){
            this.initcount=1
        }
    },
  },
 
};
</script>
<style>
</style>


